import java.util.*;

public class Player
{
   private int strength = 100;
   public Map<String,Thing> bag = new HashMap<>();
   
   public void step() {
       this.strength -= 10;
       if(this.strength<=0){
           System.out.println("不好意思，您的能量低于0，不能继续游戏");
           System.exit(1);
        }
   }
   
   public void eat(String thingName) {
       Thing thing = bag.get(thingName);
       if(thing != null) {
           this.strength += thing.getEnergy();
           if(this.strength > 100) {
               this.strength = 100;
           }
           System.out.println(this.strength);
           bag.remove(thingName);
       }else{
           System.out.println("no");
       }
   }
   
   public void pick(Thing thing){
       bag.put(thing.getName(),thing);
   }
   
   public int getStrength(){
       return this.strength;
   }
   
   public int minusStrength(){
       this.strength-=30;
       return this.strength;
   }
   
   public int plusStrength(){
       this.strength+=20;
       return this.strength;
   }
}
